cmake_minimum_required(VERSION 3.14)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


# 收集源文件 - 只保留高德地图相关文件
set(QTLOCATIONPLUGIN_SOURCES
    GaodeMapProvider.cpp
    MapProvider.cpp
    QGCMapEngine.cpp
    QGCMapTileSet.cpp
    QGCMapUrlEngine.cpp
    QGCTileCacheWorker.cpp
    QGeoCodeReplyQGC.cpp
    QGeoCodingManagerEngineQGC.cpp
    QGeoMapReplyQGC.cpp
    YCQGeoServiceProviderPlugin.cpp
    QGeoTileFetcherQGC.cpp
    QGeoTiledMappingManagerEngineQGC.cpp
    QMLControl/QGCMapEngineManager.cc
)

# 收集头文件 - 只保留高德地图相关文件
set(QTLOCATIONPLUGIN_HEADERS
    GaodeMapProvider.h
    MapProvider.h
    QGCMapEngine.h
    QGCMapEngineData.h
    QGCMapTileSet.h
    QGCMapUrlEngine.h
    QGCTileCacheWorker.h
    QGCTileSet.h
    QGeoCodeReplyQGC.h
    QGeoCodingManagerEngineQGC.h
    QGeoMapReplyQGC.h
    YCQGeoServiceProviderPlugin.h
    QGeoTileFetcherQGC.h
    QGeoTiledMappingManagerEngineQGC.h
    QMLControl/QGCMapEngineManager.h
)

add_library(QtLocationPlugin
    ${QTLOCATIONPLUGIN_SOURCES}
    ${QTLOCATIONPLUGIN_HEADERS}
)

target_link_libraries(QtLocationPlugin
    PUBLIC
        Qt5::Location
        Qt5::Sql
        Qt5::Network
)

target_include_directories(QtLocationPlugin
    PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}
        ${CMAKE_CURRENT_SOURCE_DIR}/QMLControl
)

# 设置Qt模块私有包含目录
target_include_directories(QtLocationPlugin
    PRIVATE
        ${Qt5Location_PRIVATE_INCLUDE_DIRS}
        ${Qt5Positioning_PRIVATE_INCLUDE_DIRS}
)